<?php
class IndexModule
{
	public function index()
	{
		global $_FANWE;
                
                  
		$page_args = array();
                $where = " where zp_status=1 and zp_firstdis = 1";
		$order = " ORDER BY zp_id DESC";
		$sql = 'SELECT COUNT(DISTINCT zp_id) FROM '.FDB::table('zpku').$where;
		$count = FDB::resultFirst($sql);
		$share_list = array();
		$share_display = array();
		
		if($count > 0)
		{
			$pager = buildPage('index/'.ACTION_NAME,$page_args,$count,$_FANWE['page'],40);
			$share_list = FDB::fetchAll('SELECT * FROM '.FDB::table('zpku').$where.$order.' LIMIT '.$pager['limit']);
			//$share_list = FS('zpku')->getShareDetailList($share_list,false,false,false,true,2);
						
			$col = 4;
			$index = 0;
			$share_display = array();
			foreach($share_list as $share)
			{
				$share['empty_content'] = sprintf(lang('zpku','rel_album_empty_content'),$share['zp_name']);
				$mod = $index % $col;
				$share_display['col'.$mod][] = $share;
				$index++;
			}
		
                }
		include template('page/index_index');
		display();
	}
        
}
?>